calculating a test grade